function main_isPwd(oldpwd, newpwd, pwd2) {
	if (null == oldpwd || null == newpwd || null == pwd2) {
		sys_msg("请输入新密码");
	} else {
		if (newpwd.value != pwd2.value) {
			sys_msg("你两次输入的密码不一致");
			return false;
		} else {
			main_updatePwd(oldpwd, newpwd);
		}
	}
}

function main_updatePwd(oldpwd, newpwd) {
	var parm = $('#editPassForm').serialize();
	var url = create_url('user-updatePwd');
	sys_submiting();
	$.ajax({type : 'POST',url : url,data : parm,
		success : function(result) {
			sys_submiting_close();
			if (result == 'success') {
				sys_msg('操作成功!');
				top.location = 'bsLogin1.html';
			} else {
				sys_msg('修改失败!');
			}
		}
	});
}

function main_saveUserSelf() {
	var parm = $('#editUserForm').serialize();
	var url = create_url('user-saveSelf');
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if (result == 'success') {
				sys_msg('操作成功!');
				main_loadDefault();
			} else {
				sys_warning('操作失败!');
			}
		}
	});
}
function main_saveOrganSelf() {
	var parm = $('#editOrganForm').serialize();
	var url = create_url('organ-saveSelf');
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if (result == 'success') {
				sys_msg('操作成功!');
				sys_load_handle('organ');
			} else {
				sys_msg('操作失败!');
			}
		}
	});
}

function main_loadDefault() {
	sys_loading();
	var parm = $('#queryMainForm').serialize();
	var url = sys_context_path + 'main-loadDefault.html?time=' + sys_get_time();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#mainResultList').html(result);
		}
	});
}

